package game.source.util;

import game.source.gui.GamePanel;

import java.awt.event.MouseEvent;

import javax.swing.event.MouseInputListener;

/*InputControl:
 * Gerencia o teclado/mouse e chama os métodos para cada ação.
 */
public class InputControl implements MouseInputListener{
	private InputListener	control;
	private GamePanel		controlPanel;

	public InputControl(GamePanel GamePanel,InputListener input){
		this.control = input;
		this.controlPanel = GamePanel;
		this.controlPanel.addMouseMotionListener(this);
		this.controlPanel.addMouseListener(this);
	}
	/*Mouse Control:*/
	@Override
	public void mouseDragged(MouseEvent evt){
		this.control.pressed();
		this.control.move(evt.getPoint());
	}
	@Override
	public void mouseMoved(MouseEvent evt) {
		this.control.move(evt.getPoint());
	}
	@Override
	public void mouseClicked(MouseEvent e) {}
	@Override
	public void mousePressed(MouseEvent e) {
		this.control.pressed();
	}
	@Override
	public void mouseReleased(MouseEvent e) {
		this.control.relesed();
	}
	@Override
	public void mouseEntered(MouseEvent e) {}
	@Override
	public void mouseExited(MouseEvent e) {}
}
